//C11:TimedLocking.cpp
// Limited time locking.
// {L} ZThread 
#include "zthread/Thread.h"
#include "zthread/Mutex.h"
#include "zthread/Guard.h"
using namespace ZThread;

class TimedLocking {
    Mutex lock;
    public:
        void f() {
            Guard<Mutex, TimedLockingScope<500>> g(lock);
            // ...
        }
};

int main(void) {
    TimedLocking t;
    t.f();
}
